<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/jstl/fn" prefix="fn" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
  <head>
    <html:base />
    
    <title>标题新闻管理</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style type="text/css">
.vb_wid {width:100%; margin: 0 auto; border-top:1px #FDB18D solid; background:#F5F5F5; color:#FE6500; text-indent:20px; line-height:25px; font-size:12px;}
.fb_search {width:100%; margin:0 auto; margin-top:20px; border:1px #FFCD7F solid;}
.fb_search h1 {background:#FFEFBB; margin:0px; padding:0px; line-height:28px; text-indent:10px; font-size:14px;}
.fb_s_a1 {margin:5px; font-size:14px;}
.fb_s_a2 {font-size:12px; line-height:22px; color:#999; margin-left:5px;}
.fb_ddd {width:100%; margin:0 auto; margin-top:10px; border-top:3px #FFCC00 solid; background:url(images/pen.gif) no-repeat 5px 3px; height:40px; text-indent:50px; line-height:40px; color:#464646; font-size:12px;}
.fb_nr {width:100%; margin:0 auto; margin-top:10px; line-height:22px; font-size:12px; color:#464646}
.fb_nr span {color:#FF0000;}
.fb_nr select {color:464646; font-size:12px;}
.fb_nr Div {margin-top:10px; height:30px;}
.fb_nr Div input {font-size:12px; line-height:18px;}
.inputtttt {border:1px #DEA303 solid; height:20px; color:#464646; font-size:12px; background:url(images/bottom_bg.jpg) repeat-x left top;}
.lb {background:#FFCD7F; color:#464646; font-weight:bold; text-align:center; height:30px; line-height:30px;}
.lb1 {border-bottom:1px #000000 dashed; height:28px;}
.lb1 td {border-bottom:1px #ccc dashed; background:#eefefe}
.fy1 {width:90%; margin:0 auto; margin-top:8px; background:#F8F8F8; font-size:12px; height:30px; line-height:28px; text-indent:10px;}
.fy1 span {color:#FF0000; font-weight:bold;}
.fy1 a {color:#464646; text-decoration:none;}
.fy1 a:hover {color:#FF0000; text-decoration:underline;}
</style>

<script type="text/javascript">
   var control;
   var pageValue;
   function toPage(control,pageValue)
   {
     var link='/admin/adminNewsTitleNews.do?action=search';
     var toPageLink = document.getElementById('toPageLinkpage').value;
     var toPageValue= document.getElementById('toPage').value;
     if(control!=''  && control!='toPage')
     {
       link= link + toPageLink+'&page='+pageValue;
     }
     else(control!=''  && control == 'toPage')
     {
       link= link + toPageLink+'&page='+toPageValue;
     }
    
     window.location.href=encodeURI(link);
   }
   
   var todoValue;
   var idValue;
   function todo(todoValue,idValue)
   {
      var link='/admin/adminNewsTitleNews.do?action=';
     var toPageLink = document.getElementById('toPageLinkpage').value;
     
     if(todoValue=='update')
     {
      window.location.href=encodeURI(link+'toUpdate'+toPageLink+'&id='+idValue);
     }
     else if(todoValue=='delete')
     {
     window.location.href=encodeURI(link+'delete'+toPageLink+'&id='+idValue);
     }
     else if(todoValue=='addSubhead')
     {
       window.location.href=encodeURI(link+'toAddSubhead'+toPageLink+'&id='+idValue);
     }
     
   }
</script>

</head>
  
  <body>
  <logic:present name="del">
  <bean:write name="del" filter="false"/>
  </logic:present>
  <logic:present name="update">
  <bean:write name="update" filter="false"/>
  </logic:present>
  <logic:present name="succe">
  <bean:write name="succe" filter="false"/>
  </logic:present>
   <div class="vb_wid">【标题资讯管理】 </div>
   <div class="fb_search">
   <h1>资讯搜索</h1>
   <div class="fb_s_a1">搜索内容：
    <html:form action="/admin/adminNewsTitleNews.do?action=search">
     <label>
        标题:<input type="text" id="keyWord" name="keyWord" />
        &nbsp;&nbsp;&nbsp;&nbsp;
        类型:<select id="titleType" name="titleType">
          <option value="-1">请选择</option>
          <option value="0">大标题</option>	
          <option value="1">小标题</option>
        </select>
        &nbsp;&nbsp;&nbsp;&nbsp;
       父类id:
       <input type="text" id="parenId" name="parenId"/>
     </label>
  <label>
    <input type="submit" value="提交" id="tijiao" name="tijiao" />
     </label>
     </html:form>
   </div>
</div>

<div class="fb_nr">
 
   <logic:present name="homeSiteNewsTitleNewsList">
	<logic:notEmpty name="homeSiteNewsTitleNewsList">
  	<form action="/admin/adminNewsTitleNews.do?action=search" name="theForm1" method="post" id="theForm1">
  	<table width="100%" border="1" cellspacing="1" style="font-size:12px">
    <tr class="lb">
      <td width="5%">ID</td>
      <td width="30%">资讯标题</td>
      <td width="10%">位置</td>
      <td width="15%">添加时间</td>
      <td width="5%">类型</td>
      <td width="5%">修改</td>
      <td width="5%">父类id</td>
      <td width="5%">小标题</td>
      <td width="5%">删除</td>
    </tr>

	<logic:iterate id="list" name="homeSiteNewsTitleNewsList">
      <tr class="lb1">
        <td align="center"><label>
        <c:out value="${list.id}"/>
        </label>
        </td>
        <td align="center"><c:out value="${list.titleName}"/></td>
        <td align="center">
        	<c:if test="${list.siteType == 'index'}">总站首页</c:if>
        	<c:if test="${list.siteType == 'newsIndex'}">资讯中心</c:if>
        </td>
        <td align="center"><c:out value="${fn:substring(list.addTime,0,16)}"/></td>
        <td align="center">
          <c:if test="${list.titleType == '1'}">
             小标题
          </c:if>
          <c:if test="${list.titleType == '0'}">
             大标题
          </c:if>
        </td>
        <td align="center">
        <a href="javascript:todo('update',${list.id});void 0;">修改</a>
        </td>
         <td align="center">
         <c:if test="${list.parenId!=null}">
        <c:out value="${list.parenId}"></c:out>
        </c:if>
        <c:if test="${list.parenId==null}">
           &nbsp;&nbsp;
        </c:if>
        </td>
         <td align="center">
          <c:if test="${list.titleType != '1'}">
             <a href="javascript:todo('addSubhead',${list.id});void 0;">添加</a>
          </c:if>
          
          <c:if test="${list.titleType == '1'}">
             &nbsp;&nbsp;
          </c:if>
          
        </td>
       <td align="center">
               <a href="javascript:todo('delete',${list.id});void 0;">删除</a>
        </td>
      </tr>
      
   </logic:iterate>
	
	<tr>
	<td colspan=12>
	      <table width="100%" border="0" cellspacing="1" style="font-size:12px">
            <tr>
               <td colspan="8">
              
                       有 <span class="red1">${recordNum}</span>条记录。当前第${curPage}页,共${allPage}页
    <logic:notEmpty name="recordNum">
	<c:if test="${recordNum>0}">
		<c:if test="${curPage>1}">
		     <html:link href="javascript:toPage('beforePage','${backPage}'); void 0;" >上一页</html:link>
		</c:if>
		<%--  页码循环 --%>
		<c:if test="${(curPage>=1)&&(curPage<=7)&&(allPage<8)}">
		<c:forEach begin="${1}" end="${allPage}" var="page" step="1" varStatus="pageCount">
			<b>&nbsp;
			<html:link href="javascript:toPage('beforePage','${page}'); void 0;" >
				[<c:if test="${curPage==page}">
					<font color="red" class="one">
						<c:out value="${pageCount.index}"></c:out> 
					</font>
				</c:if>
				<c:if test="${curPage!=page}">
						<c:out value="${pageCount.index}"></c:out>
				</c:if>]
			</html:link>
			</b>
		</c:forEach>
		</c:if>
		<c:if test="${(curPage>=1)&&(curPage<=7)&&(allPage>8)}">
		<c:forEach begin="${1}" end="${8}" var="page" step="1" varStatus="pageCount">
			<b>&nbsp;
			<html:link href="javascript:toPage('beforePage','${page}'); void 0;" >
				[<c:if test="${curPage==page}">
					<font color="red" class="one">
						<c:out value="${pageCount.index}"></c:out> 
					</font>
				</c:if>
				<c:if test="${curPage!=page}">
						<c:out value="${pageCount.index}"></c:out>
				</c:if>]
			</html:link>
			</b>
		</c:forEach>
		</c:if>
		<c:if test="${curPage>7&&(allPage>(curPage+4))}">
		 <html:link href="javascript:toPage('beforePage','${page}'); void 0;" >1</html:link>....
		<c:forEach begin="${(curPage-3)}" end="${(curPage+4)}" var="page" step="1" varStatus="pageCount">
			<b>&nbsp;
			<html:link href="javascript:toPage('beforePage','${page}'); void 0;" >
				[<c:if test="${curPage==page}">
					<font color="red" class="one">
						<c:out value="${pageCount.index}"></c:out> 
					</font>
				</c:if>
				<c:if test="${curPage!=page}">
						<c:out value="${pageCount.index}"></c:out>
				</c:if>]
			</html:link>
			</b>
		</c:forEach>
		</c:if>
		<c:if test="${curPage>7&&(allPage<=(curPage+4))}">
         <html:link href="javascript:toPage('beforePage','${page}'); void 0;" >1</html:link>....
		<c:forEach begin="${(curPage-3)}" end="${allPage}" var="page" step="1" varStatus="pageCount">
			<b>&nbsp;
			<html:link href="javascript:toPage('beforePage','${page}'); void 0;" >
				[<c:if test="${curPage==page}">
					<font color="red" class="one">
						<c:out value="${pageCount.index}"></c:out> 
					</font>
				</c:if>
				<c:if test="${curPage!=page}">
						<c:out value="${pageCount.index}"></c:out>
				</c:if>]
			</html:link>
			</b>
		</c:forEach>
		</c:if>

			<c:if test="${curPage<allPage}">
			<html:link href="javascript:toPage('nextPage','${nextPage}'); void 0;" >下一页</html:link>
			</c:if>
            <c:if test="${(allPage>1)&&(curPage<allPage)}">
<html:link href="javascript:toPage('endPage','${allPage}'); void 0;" >尾页</html:link>   
			</c:if>
	</c:if>
	</logic:notEmpty>        
               

                到
                 <form id="searchForm123" name="searchForm123">
                 	<input type="hidden" id="toPageLinkpage"  value="&keyWord=${adminNewsTitleNewsForm.keyWord!=null?adminNewsTitleNewsForm.keyWord:''}&link=${adminNewsTitleNewsForm.link!=null?adminNewsTitleNewsForm.link:''}&titleType=${adminNewsTitleNewsForm.titleType==null?adminNewsTitleNewsForm.titleType:''}&parenId=${adminNewsTitleNewsForm.parenId==null?adminNewsTitleNewsForm.parenId:''}&page=${adminNewsTitleNewsForm.page==null?adminNewsTitleNewsForm.page:''}&pageSize=${adminNewsTitleNewsForm.pageSize==null?adminNewsTitleNewsForm.pageSize:''}" />
               	  <input id="toPage"  name="toPage" type="text" size="2"/>
    页&nbsp;
    
      <input type="button"  value=" " style="background-image: url('/admin/images/ck.gif');border:0px;width:58px;"  title="查看"  onclick="return toPage('toPage','toPage');"/>
    
    
     </form>    
               </td>
                              
                              
            </tr>
           </table>
	</td>
	</tr>
    </table>
    
    </form>
    
    	</logic:notEmpty>
	</logic:present>
	
   <h1><img src="image/qqddc_shop1.gif" width="720" height="8" /></h1>
</div>
	

  </body>
</html:html>










